package com.example.wj.dao;

import com.example.wj.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserDao {

    int insert(User user);

    int insertBatch(@Param("entities") List<User> entities);

    int insertOrUpdateBatch(@Param("entities") List<User> entities);

    int update(User user);

    int deleteById(int id);

    User queryById(int id);

    List<User> queryAllByLimit(User user, @Param("pageable") Pageable pageable);

    long count(User user);

    // 校验用户名密码
    User checkUserInfo(String username, String password);
}

